{% extends 'style/base/base.html' %}{% load staticfiles %}
{% block style %}
{{ block.super }}
  <!-- bootstrap datepicker -->
  <link rel="stylesheet" href="{% static "plugins/datepicker/datepicker3.css" %}">
{% endblock style %}
  {% block content-header %}
    <section class="content-header">
      <h1>
        添加顾客
        <small>操作面板</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
        <li class="active">添加顾客</li>
      </ol>
    </section>
  {% endblock content-header %}
  {% block content %}
    <hr>
    <section class="content">
      <div class="col-sm-12">
        <div class="box box-primary">
          <div class="box-header with-border">
            <h4>
              添加顾客信息 <small> 请在各选项卡中填写所需要的顾客信息</small>
            </h4>

          </div>
        {% if form %}
          <form id="add_customer" action="/customer/add" class="layui-form form-horizontal" method="POST">
            <div class="box-body">
            <!-- Custom Tabs -->
              <div class="nav-tabs-custom">
                <ul class="nav nav-tabs">
                  <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">基本资料</a></li>
                  <li class=""><a href="#tab_2" data-toggle="tab" aria-expanded="false">扩展资料</a></li>
                  <li class=""><a href="#tab_3" data-toggle="tab" aria-expanded="false">备注信息</a></li>
                </ul>
          <div class="tab-content">
            <div class="tab-pane active" id="tab_1">
              {% csrf_token %}

              {% for field in form %}
                {% if  field.name not in ex_list %}
                <div class="form-group">
                  <label class="col-sm-1 control-label">{{ field.label_tag }}</label>
                  <div class="col-sm-5">
                      {{ field }}
                  </div>
                  {{ field.errors }}
                </div>
                {% endif %}
              {% endfor %}

            </div>
            <!-- /.tab-pane -->
            <div class="tab-pane" id="tab_2">
              {% for field in form %}
                {% if  field.name in ex_list and field.name != 'customer_memo' %}
                  <div class="form-group">
                    <label class="col-sm-1 control-label">{{ field.label_tag }}</label>
                    <div class="col-sm-5">
                      {{ field }}
                    </div>
                    {{ field.errors }}
                  </div>
                {% endif %}
              {% endfor %}
            </div>
            <!-- /.tab-pane -->
            <div class="tab-pane" id="tab_3">
                <div class="form-group">
                  <label class="col-sm-1 control-label">{{ form.customer_memo.label_tag }}</label>
                  <div class="col-sm-9">
                    {{ form.customer_memo }}
                  </div>
                  {{ form.customer_memo.errors }}
                </div>
            </div>
            <!-- /.tab-pane -->
          </div>
          <!-- /.tab-content -->
        </div>
        <!-- nav-tabs-custom -->
      </div>
            <div class="box-footer">
              <input class="btn btn-primary" type="submit" value="添加">
            </div><!-- /.col -->
          </form>
        {% endif %}
        </div>
      </div>
    </section>
  {% endblock content %}
{% block script %}
{{ block.super }}
{% endblock script %}